package org.example.mytask.service.impl;

import org.example.mytask.dao.PurchasingContractReviewMapper;
import org.example.mytask.domain.PurchasingContractReview;
import org.example.mytask.service.PurchasingContractReviewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Service
public class PurchasingContractReviewServiceImpl implements PurchasingContractReviewService {
    @Autowired
    private PurchasingContractReviewMapper purchasingContractReviewMapper;
    @Override
    public List<PurchasingContractReview> select(PurchasingContractReview purchasingContractReview) {
        return purchasingContractReviewMapper.select(purchasingContractReview);
    }
    @Override
    public PurchasingContractReview selectById(int id){
        return purchasingContractReviewMapper.selectById(id);
    }
    @Override
    public int update(PurchasingContractReview purchasingContractReview) {
        SimpleDateFormat sdf = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
        Date now = new Date();
        purchasingContractReview.setReviewer_date(sdf.format(now));
        return purchasingContractReviewMapper.update(purchasingContractReview);
    }

}



















